#include <stdio.h>
int main()
{
    float taxRates[][2] = {
        {0, 0.03},
        {1500, 0.1},
        {4500, 0.2},
        {9000, 0.25},
        {35000, 0.3},
        {55000, 0.35},
        {80000, 0.45}
    };
    int length = sizeof(taxRates)/(2*sizeof(int));
    float salary, tax, tempSalary, sub, temp;
    while(scanf("%f", &salary) != EOF){
        tax = 0;
        if(salary > 3500){
            tempSalary = salary - 3500;
            for(int i=1; i<length; i++){
                sub = taxRates[i][0] - taxRates[i-1][0];
                temp = tempSalary - sub;
                if(temp >= 0){
                    tax += sub*taxRates[i-1][1];
                    tempSalary -= sub;
                }else{
                    tax += tempSalary * taxRates[i-1][1];
                    break;
                }
                if(i == length - 1)
                    tax += tempSalary * taxRates[i][1];
            }
        }
        printf("%.f\n", salary - tax);
    }
    return 0;
}